package com.yazi.mxz.common.entity.beans;

import com.myframework.smhj.hibernate.Entity;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.SEQUENCE;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;

/**
 * Category entity. @author MyEclipse Persistence Tools
 */
@javax.persistence.Entity
@Table(name = "MXZ_CATEGORY", schema = "MXZ")
public class Category extends Entity implements java.io.Serializable {

	// Fields

	private Long catId;
	private Category category;
	private Integer type;
	private String name;
	private Integer deep;
	private String pic;
	private Long sort;
	private Long updateTime;
	private Set<Cook> cooksForStyleId = new HashSet<Cook>(0);
	private Set<Ad> ads = new HashSet<Ad>(0);
	private Set<Cook> cooksForTimeId = new HashSet<Cook>(0);
	private Set<StoreGoods> storeGoodses = new HashSet<StoreGoods>(0);
	private Set<StorePromote> storePromotes = new HashSet<StorePromote>(0);
	private Set<SpecType> specTypes = new HashSet<SpecType>(0);
	private Set<Category> categories = new HashSet<Category>(0);
	private Set<Article> articles = new HashSet<Article>(0);
	private Set<StorePay> storePaies = new HashSet<StorePay>(0);
	private Set<Cook> cooksForTypeId = new HashSet<Cook>(0);
	private Set<StoreDelivery> storeDeliveries = new HashSet<StoreDelivery>(0);
	private Set<Goods> goodses = new HashSet<Goods>(0);

	// Constructors

	/** default constructor */
	public Category() {
	}

	/** minimal constructor */
	public Category(Integer type, String name, Integer deep, Long sort,
			Long updateTime) {
		this.type = type;
		this.name = name;
		this.deep = deep;
		this.sort = sort;
		this.updateTime = updateTime;
	}

	/** full constructor */
	public Category(Category category, Integer type, String name, Integer deep,
			String pic, Long sort, Long updateTime, Set<Cook> cooksForStyleId,
			Set<Ad> ads, Set<Cook> cooksForTimeId,
			Set<StoreGoods> storeGoodses, Set<StorePromote> storePromotes,
			Set<SpecType> specTypes, Set<Category> categories,
			Set<Article> articles, Set<StorePay> storePaies,
			Set<Cook> cooksForTypeId, Set<StoreDelivery> storeDeliveries,
			Set<Goods> goodses) {
		this.category = category;
		this.type = type;
		this.name = name;
		this.deep = deep;
		this.pic = pic;
		this.sort = sort;
		this.updateTime = updateTime;
		this.cooksForStyleId = cooksForStyleId;
		this.ads = ads;
		this.cooksForTimeId = cooksForTimeId;
		this.storeGoodses = storeGoodses;
		this.storePromotes = storePromotes;
		this.specTypes = specTypes;
		this.categories = categories;
		this.articles = articles;
		this.storePaies = storePaies;
		this.cooksForTypeId = cooksForTypeId;
		this.storeDeliveries = storeDeliveries;
		this.goodses = goodses;
	}

	// Property accessors
	@SequenceGenerator(name = "generator", sequenceName = "SEQ_CATEGORY")
	@Id
	@GeneratedValue(strategy = SEQUENCE, generator = "generator")
	@Column(name = "CAT_ID", unique = true, nullable = false, precision = 15, scale = 0)
	public Long getCatId() {
		return this.catId;
	}

	public void setCatId(Long catId) {
		this.catId = catId;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "PARENT_ID")
	public Category getCategory() {
		return this.category;
	}

	public void setCategory(Category category) {
		this.category = category;
	}

	@Column(name = "TYPE", nullable = false, precision = 2, scale = 0)
	public Integer getType() {
		return this.type;
	}

	public void setType(Integer type) {
		this.type = type;
	}

	@Column(name = "NAME", nullable = false, length = 100)
	public String getName() {
		return this.name;
	}

	public void setName(String name) {
		this.name = name;
	}

	@Column(name = "DEEP", nullable = false, precision = 2, scale = 0)
	public Integer getDeep() {
		return this.deep;
	}

	public void setDeep(Integer deep) {
		this.deep = deep;
	}

	@Column(name = "PIC", length = 200)
	public String getPic() {
		return this.pic;
	}

	public void setPic(String pic) {
		this.pic = pic;
	}

	@Column(name = "SORT", nullable = false, precision = 15, scale = 0)
	public Long getSort() {
		return this.sort;
	}

	public void setSort(Long sort) {
		this.sort = sort;
	}

	@Column(name = "UPDATE_TIME", nullable = false, precision = 15, scale = 0)
	public Long getUpdateTime() {
		return this.updateTime;
	}

	public void setUpdateTime(Long updateTime) {
		this.updateTime = updateTime;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "categoryByStyleId")
	public Set<Cook> getCooksForStyleId() {
		return this.cooksForStyleId;
	}

	public void setCooksForStyleId(Set<Cook> cooksForStyleId) {
		this.cooksForStyleId = cooksForStyleId;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "category")
	public Set<Ad> getAds() {
		return this.ads;
	}

	public void setAds(Set<Ad> ads) {
		this.ads = ads;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "categoryByTimeId")
	public Set<Cook> getCooksForTimeId() {
		return this.cooksForTimeId;
	}

	public void setCooksForTimeId(Set<Cook> cooksForTimeId) {
		this.cooksForTimeId = cooksForTimeId;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "category")
	public Set<StoreGoods> getStoreGoodses() {
		return this.storeGoodses;
	}

	public void setStoreGoodses(Set<StoreGoods> storeGoodses) {
		this.storeGoodses = storeGoodses;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "category")
	public Set<StorePromote> getStorePromotes() {
		return this.storePromotes;
	}

	public void setStorePromotes(Set<StorePromote> storePromotes) {
		this.storePromotes = storePromotes;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "category")
	public Set<SpecType> getSpecTypes() {
		return this.specTypes;
	}

	public void setSpecTypes(Set<SpecType> specTypes) {
		this.specTypes = specTypes;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "category")
	public Set<Category> getCategories() {
		return this.categories;
	}

	public void setCategories(Set<Category> categories) {
		this.categories = categories;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "category")
	public Set<Article> getArticles() {
		return this.articles;
	}

	public void setArticles(Set<Article> articles) {
		this.articles = articles;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "category")
	public Set<StorePay> getStorePaies() {
		return this.storePaies;
	}

	public void setStorePaies(Set<StorePay> storePaies) {
		this.storePaies = storePaies;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "categoryByTypeId")
	public Set<Cook> getCooksForTypeId() {
		return this.cooksForTypeId;
	}

	public void setCooksForTypeId(Set<Cook> cooksForTypeId) {
		this.cooksForTypeId = cooksForTypeId;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "category")
	public Set<StoreDelivery> getStoreDeliveries() {
		return this.storeDeliveries;
	}

	public void setStoreDeliveries(Set<StoreDelivery> storeDeliveries) {
		this.storeDeliveries = storeDeliveries;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "category")
	public Set<Goods> getGoodses() {
		return this.goodses;
	}

	public void setGoodses(Set<Goods> goodses) {
		this.goodses = goodses;
	}

}